package cn.lyq.card.ui.course

import android.widget.ImageView
import cn.lyq.card.R
import cn.lyq.card.data.model.BillTypeInfo
import cn.lyq.card.data.model.CashRecordInfo
import cn.lyq.card.data.model.CourseInfo
import cn.lyq.card.utils.loadUrl
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder


class CourseAdapter : BaseQuickAdapter<CourseInfo, BaseViewHolder>
    (R.layout.item_course, mutableListOf()), LoadMoreModule {

    override fun convert(holder: BaseViewHolder, item: CourseInfo) {
        holder.setText(R.id.tvTitle, item.title ?: "")
        holder.setText(R.id.tvContent, item.description ?: "")
        holder.setText(R.id.tvDate, item.addTime ?: "")

        holder.getView<ImageView>(R.id.img).loadUrl(item.image)
        holder.setVisible(R.id.tvShadow, holder.adapterPosition != itemCount - 1)
    }
}